package com.zhihaoliang.moshi.util

import android.util.Log
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.Moshi
import okio.Buffer


/**
 * @author 支豪亮
 * @date 2023/1/20 09:33
 * @des Log 信息的打印
 */

fun log(msg: String?) {
    Log.e("moshi",  msg ?: "null")
}

fun <T>logJson(t: T, jsonAdapter:JsonAdapter<T>){
    val adapter =jsonAdapter.indent("   ")
    val result = adapter.toJson(t)
    log(result)
}